package com.sky.context;

public class BaseContext {
//    ThreadLocal工具类，用来存储当前线程的临时变量，只有当前线程可以用，
//    客户端一次请求就是一个线程

    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    public static Long getCurrentId() {
        return threadLocal.get();
    }

    public static void removeCurrentId() {
        threadLocal.remove();
    }

}
